<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>
<body>
<div class="wrapper animated fadeInLeft">
    <div class="row">
        <div>
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>订单信息 <small class="m-l-sm">（价格、订单号、金额、时间等信息）</small></h5>
                    </div>
                    <div class="ibox-content p-xl">
                        <div class="row">
                            <div class="col-sm-12 text-right">
                                <h4>订单号：</h4>
                                <h4 class="text-navy" th:text="${userOrderIfo['orderNo']}"></h4>
                                <h4>下单用户：</h4>
                                <h4 class="text-navy">
                                    <samp data-toggle="tooltip" data-placement="bottom" data-original-title="手机号">
                                        <span th:if="!${#strings.isEmpty(userOrderIfo['user']['mobile'])}" th:text="${userOrderIfo['user']['mobile']}"></span>
                                        <span th:if=" ${#strings.isEmpty(userOrderIfo['user']['mobile'])}"> —</span>
                                    </samp>/
                                    <samp data-toggle="tooltip" data-placement="bottom" data-original-title="邮箱号">
                                        <span th:if=" !${#strings.isEmpty(userOrderIfo['user']['eamil'])}" th:text="${userOrderIfo['user']['eamil']}"></span>
                                        <span th:if=" ${#strings.isEmpty(userOrderIfo['user']['eamil'])}"> —</span>
                                    </samp>/
                                    <samp data-toggle="tooltip" data-placement="bottom" data-original-title="账号">
                                        <span th:if=" !${#strings.isEmpty(userOrderIfo['user']['loginAccount'])}" th:text="${userOrderIfo['user']['loginAccount']}"></span>
                                        <span th:if=" ${#strings.isEmpty(userOrderIfo['user']['loginAccount'])}"> —</span>
                                    </samp>/
                                    <samp data-toggle="tooltip" data-placement="bottom" data-original-title="昵称">
                                        <span th:if=" !${#strings.isEmpty(userOrderIfo['user']['nickname'])}" th:text="${userOrderIfo['user']['nickname']}"></span>
                                        <span th:if=" ${#strings.isEmpty(userOrderIfo['user']['nickname'])}"> —</span>
                                    </samp>
                                </h4>
                                <p>
                                    <span th:if="${userOrderIfo['orderStatus']}=='INIT'">
                                        <span class="text-navy"><strong>状态：</strong>未支付</span><br/>
                                    </span>
                                    <span th:if="${userOrderIfo['orderStatus']}=='SUCCESS'">
                                        <span><strong>状态：</strong>已支付</span><br/>
                                    </span>
                                    <span th:if="${userOrderIfo['orderStatus']}=='REFUND'">
                                        <span class="text-navy"><strong>状态：</strong>已退款</span><br/>
                                    </span>
                                    <span th:if="${userOrderIfo['orderStatus']}=='CANCEL'">
                                        <span class="text-navy"><strong>状态：</strong>已取消</span><br/>
                                    </span>
                                    <span>
                                        <strong>下单时间：</strong>
                                        <span th:text="${userOrderIfo['createTime']}"></span>
                                    </span>
                                </p>
                            </div>
                        </div>
                        <div class="table-responsive m-t">
                            <table class="table invoice-table">
                                <thead>
                                <tr>
                                    <th>清单</th>
                                    <th>数量</th>
                                    <th>原价</th>
                                    <th>优惠</th>
                                    <th>活动</th>
                                    <th>金额</th>
                                </tr>
                                </thead>
                                <tbody>
                                    <tr th:if="!${#lists.isEmpty(userOrderIfo['orderDetailsList'])}" th:each="details:${userOrderIfo['orderDetailsList']}">
                                        <td>
                                            <div>
                                                <strong>
                                                    <span th:if="${details['shopType']}=='COURSE'" th:text="${details['shopName']}+'[课程]'"></span>
                                                    <span th:if="${details['shopType']}=='BOOK'" th:text="${details['shopName']}+'[图书]'"></span>
                                                    <span th:if="${details['shopType']}=='MEMBER'" th:text="${details['shopName']}+'[会员]'"></span>
                                                    <span th:if="${details['shopType']}=='ACCOUNT'" th:text="'账户充值'"></span>
                                                    <span th:if="${details['shopType']}=='QA'" th:text="${details['shopName']}+'[问答]'"></span>
                                                    <span th:if="${details['shopType']}=='ATTEND'" th:text="${details['shopName']}+'[旁听]'"></span>
                                                    <span th:if="${details['shopType']}=='EXAM'" th:text="${details['shopName']}+'[课程]'"></span>
                                                </strong>
                                            </div>
                                        </td>
                                        <td th:text="${details['buyNum']}"></td>
                                        <td>
                                            <i class="fa fa-rmb"></i>
                                            <span th:text="${details['price']}"></span>
                                        </td>
                                        <td>-<i class="fa fa-rmb"></i><span th:text="${details['yhPrice']}"></span></td>
                                        <td>-<i class="fa fa-rmb"></i><span th:text="${details['activityPrice']}"></span></td>
                                        <td><i class="fa fa-rmb"></i><span th:text="${details['realPrice']}"></span></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <!-- /table-responsive -->
                        <table class="table invoice-total">
                            <tbody>
                            <tr>
                                <td><strong>实付金额：</strong>
                                </td>
                                <td><i class="fa fa-rmb"></i>
                                    <span th:text="${userOrderIfo['realPrice']}"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><strong>总优惠：</strong>
                                </td>
                                <td>- <i class="fa fa-rmb"></i>
                                    <span th:text="${userOrderIfo['activityPrice']}+${userOrderIfo['yhPrice']}"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><strong>总计</strong>
                                </td>
                                <td><i class="fa fa-rmb"></i>
                                    <span th:text="${userOrderIfo['realPrice']}+${userOrderIfo['freightPrice']}"></span>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="text-right">
                            <button class="btn btn-default" id="printPageBtn"><i class="fa fa-print"></i> 打印单据</button>
                        </div>
                        <div class="well m-t">
                            <strong>其它信息：</strong> 打印订单只是需要自己的单据，不提供法理依据。
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div data-th-replace="layout/head-footer"></div>
<script>
    $(function() {
        $('body').on('click', '#printPageBtn', function() {
            window.print()
        })
    })
</script>
</body>
</html>

